package com.林子祺.全名健康管理系统.entity.login;

import com.林子祺.全名健康管理系统.entity.article.content.article.CurrentIndexData;
import com.林子祺.全名健康管理系统.util.ArticleStructure;
import com.林子祺.全名健康管理系统.util.CollectionStructure;

import java.util.ArrayList;

public class CollectionData {

    static ArrayList<CollectionStructure> cs = new ArrayList<>();

    public static void InputData(String user, String collection){
        cs.add(new CollectionStructure(user,collection));
    }

    public static boolean OutputCollectionData(int number){
        if(number < cs.size()){
            CollectionStructure p = cs.get(number);
            CurrentCollectionData.user = p.getUser();
            CurrentCollectionData.collection = p.getCollection();
            return true;
        }
        else
            return false;
    }

    public static void Refresh(){
        if(cs.size() != 0)
            cs.removeAll(cs);
    }

}
